home *** CD-ROM | disk | FTP | other *** search
-
- Text Modifier V2.8
-
- by John Augustine
-
- TM (Text Modifier) was written in Assembly for MS Dos systems. Requires
- Color Graphics CGA or better. Does not need a lot of memory. I have tested TM
- on an old 8088 Computer and a Computer with the Pentium.
-
- NOTE: See "IMPROVE.DOC" for more Information about New Features.
-
- There are times when you would like to Automatically Modify a Document/s,
- which is too much trouble to do manually using a Word Processor or Text
- Editor. TM to the "Rescue".
-
- TM Creates another Text file/s, or Prints a Text file with or without
- Modifications. The original Input Text file/s is NEVER altered.
-
- Some optional TM features are:
-
- 1. A "Stripper" which can Remove parts of every line.
- 2. Replace all non-Text (except CR,LF) characters with spaces.
- 3. Convert all lower case letters to Upper case.
- 4. View "Long Line" (more than 80 characters long) Documents by Wrapping
- (not Word Wrap) at the 80th column.
- 5. Reformat large Documents for Printing more efficiently. In some cases,
- using only 1/3 the amount of paper!
-
- 6. "Modify" Text as follows:
-
- 1.1 Remove a specified number of spaces from the beginning of every line.
- 1.2 Remove a specified number of spaces from the end of every line.
- NOTE: 1.1 and 1.2 removes the specified number of spaces or less. The
- user specified amount is actually the Maximum Limit.
- 1.3 Remove a specified Sequence of spaces (lower amounts are ignored)
- anywhere in text.
- 2. Reduce a Character/s or Pattern Sequence to a specified amount.
- 3. Remove a Character/s or Pattern Sequence.
- 4. Replace a Character/s or Pattern Sequence with another.
- 5. Keep (Extract) lines from a Document that contain a specified Pattern.
- 6. Keep all lines except (Exclude) lines that contain a specified Pattern.
- 7. Other Modify Options:
- 7.1 Clip a Portion/s of a Text file. Uses Line Number (User Input) counter
- reference.
- 7.2 Reformat and/or Add CRs (+LFs) to a Text File.
-
- Note: 2,4,5,and 6 have three Categories of Character Patterns while 3 has
- four Categories:
-
- A. Case Sensitive.
- B. Case Insensitive.
- C. Numbers (Decimal) which can represent Non-Text Characters eg.
- Control characters. Example 13 = Carriage Return, 10 = Line Feed, etc.
-
- Note: "Modify" 3 (Remove ....) also has the Option to Remove everything
- between Two Specified Patterns including the Two Patterns.
-
- When I refer to CR (Carriage Return), it should be understood that it
- usually is accompanied by a LF (Line Feed). When I use "Modifications" (in
- quotes), I am referring to the Procedures relative to "Modify Parameters".
- These are not the only Procedures that actually modify a file by TM. Consider
- them the main Modification procedures.
-
- EXAMPLES OF TM'S USEFULNESS:
-
- Note: Examples 1, 2, 3 relate to a List of Program Files (Files available at
- a BBS or FTP Site)
-
- 1. To see (via "View...") only 1997 Files in the List. Select "Modify"
- option number 5 and enter /97 for the Pattern. Select "View..." in Main Menu.
- Don't confuse this with Text Editor's Search. TM will display a Screen full
- (View many at one time), instead of one at a time, as in a Text Editor's
- Search. Note: This will not show you additional Lines of information for each
- file, if your List contains them.
-
- 2. To Create a File (List) of only GIF files, select Modify option number 5
- and enter Case Sensitive pattern ".GIF". Only lines with that Pattern will go
- into the New File you are Creating.
-
- 3. Removing unnecessary lines from the file using "Modify" 6:
-
- Enter Case Sensitive "DL Time" for the Pattern. Check results with the
- "View...." and you should see all lines, Except those which contain Download
- information. I'm assuming that it is a separate line. Just look for
- something unique in lines you don't want.
-
- 4. Just about all text editors and word processors can Replace one Pattern
- with another. Can they replace Control characters eg. CRs?, Add LFs (Line
- Feed) to a Document that doesn't have any? Add two CRs,LFs in place of one
- for Double space Printing? Modify other Non-Text or Control characters? TM
- can. Here is an example for using TM's "Modify" option number 4 to add LFs to
- a document that contain only CRs:
-
- Select number 3. Enter the Decimal number 13 (CR) and press Enter. Next
- enter Decimal number 13,10 (10 is LF) for the "Replacement" Pattern and press
- enter. All CRs will be replaced by CRs and LFs.
-
- 5. Here is an actual case I had using someone's "Vectors" Program. The
- Computer's Interrupt Vectors displayed on the Screen, or Printed (Printer) in
- Columns was very nice. When I redirected the Output to a File, there was no
- CRs anywhere in the Text, and everything "ran together". Again, TM to the
- Rescue. I selected "Modify" number 4.3 (Replace a Characters/Pattern using
- Numbers). For the Pattern, I entered Decimal number 73 (Ascii number for
- Upper Case letter I (Int)). For the Replace Pattern, I entered, 13,10,73
- (CR,LF,I). The Modified File I created was properly formatted and easy to
- view. I simply replaced the "I", which was the first character of every line
- with a CR,LF, and Letter I (restore I).
-
- 6. Reformating a "Long Line" Text file such as .WRI files so you can edit the
- file in a Dos based Text Editor. Use "Modify" option number 7.2 (Press 7, then
- select number 2). Enter 79 for up to 79 characters per line with Word Wrap.
-
- Tip: In some cases, if you have a large Document which does not display a
- "List" anywhere, you can Reformat ("Modify" 7.2) the Document for very
- Compressed Printing, say 200 or more Characters per Line (with Word Wrap).
- Talk about saving paper.
-
- 7. With a New Feature (V2.7) added to "Modify 3", you can convert some forms
- of Text Files such as Hypertext to a regular Ascii Text file by Removing the
- embedded Parameters. Example: "<Font Size =+3...>". For the Left (Start)
- Pattern, I entered (without quotes) "<" and the Right (End) Pattern, I entered
- ">". Everything between the "<" and ">" was Removed including "<>". I
- Created a regular Ascii Text file that I can easily Read with any Ascii Text
- Viewer.
-
- 8. With an Enhanced (V2.7) "Modify 2", I can Reduce a sequence of CR,LFs. I
- received a Document that contained many Blank lines separating Paragraphs. I
- wanted One Blank line between each Paragraph. I entered for "Modify" 2.3,
- 13,10 for the Pattern and selected a Sequence of 2 which sets the Maximum
- Consecutive sequence of 13,10 to Two (Example: 13,10,13,10). Note: The first
- "13,10" is the end of the last line in a paragraph and the second "13,10"
- creates the Blank Line.
-
- 9. Printing a very large Document (Example: Program Instructions):
-
- Many Program Instructions are very large. In some of them, all lines are
- indented 10 (some more, some less) spaces. I used TM and Viewed the document.
- TM has a Scale and I used that to see how many spaces before the text starts.
- I selected "Modify" 1 for Space removal and selected 1 to remove spaces from
- the beginning of each line and entered 9, which leaves 1 Space at the
- beginning of each "Regular" Line, used to Separate the Last word of the
- previous line from the First word on the Next line. I returned to Main Menu
- and toggled Back Page Printing to ON. I selected "Print a Text File". I
- selected 2, "Toggle Preserve Carriage Returns" to OFF. I selected 3, "Toggle
- Compress Mode (132 characters per line)" to ON. Note: when you press 2 or 3,
- you will see a message with useful information. I printed the Document using a
- little more than 1/3 the amount of paper it normally would take.
-
- When I toggled Compress mode ON, and preserve Carriage Returns OFF, words
- from the next line are added to make longer lines with Word Wrap. Even with
- this set to OFF, lines in which text starts 2 or more spaces from the
- beginning will have their CR (Carriage Returns) Preserved, as well as lines
- with only a CR (used for creating blank lines between paragraphs).
-
- Here is an example of why there are Exceptions in the Procedure that is
- "told" NOT to preserve CRs.
-
- This is a part of Instructions for a Utility program:
-
- <CR>
- A. Format a Disk<CR>
- B. Delete a File<CR>
- C. Rename a File<CR>
- D. etc....
-
- The first CR was used to create a blank line. We would not want to remove
- that. The "List" of commands would end up in a line rather than in a column if
- this condition was overlooked. Remember, it is important that any "List" of
- commands, etc., be indented (usually is) at least two spaces in the document,
- when you turn Off Preserve CRs.
-
- It is Important therefore to Look at the Text First. Use "Read a Text File"
- so you can see the file in it's original form (unless "Long Line" text). Try
- out different settings if you are not sure of the outcome. Use "View a Text
- File" to see the results before you Print the file or Create another file.
- Note: Original File is Never Altered.
-
- NOTE: "Long Line" text refers to lines that are longer than 80 characters
- before ending with a CR. One source for "Long Line" Text is Windows based Text
- Editors.
-
- Note: Since Reformat Procedures are used by both the Printer routines (Not
- Preserve CRs) and "Modify" 7.2, you can't Reformat a file and Print it at the
- same time. TM will bring that to your attention if you try.
-
- Clipping ("Modify" 7.1) portions of a File allows you to enter line number
- references. Normally, you use the "Lines" number display at the bottom of the
- screen in "View" or "Read" Modes. IMPORTANT: If you are Reformating ("Modify"
- 7.2) and Clipping ("Modify" 7.1) the File at the same time, use the "VIEW" (Not
- "Read") after setting the Reformat Parameters, in order to get the correct Line
- number/s reference. Then set the Clipping Parameters. Most text editors allow
- you to Clip portions of a text file, but TM is good for very large text files
- up to 65,535 lines. There is an exception, if you were Clipping (removing) to
- the End of a file, "FROM" a Line reference that does NOT exceed 65,535, then
- the number of Lines in the File can be in the millions.
-
- Does it bother you when you can't see where the CRs are in your text? Most
- Text editors and Word Processors that I have used don't display CRs. TM makes
- them very obvious. TM (V2.7) lets you see if the Document has both CR and LF
- (Normal) or just CR, by the Color of the Symbol used to represent a CR/LF
- (White = CR,LF and Magenta = CR without LF).
-
- I am going to stop here and tell you something about the Sequential Order
- in which "Modifications" and other Modifying (Stripping, etc.) functions occur
- on each "Line" of a document by TM. Note: Documents without CRs, the "Line"
- ends at around 6,300 characters. This may be important to know if a variety
- of Modifications are to be performed on the Document in one Pass (usually
- not). Let's assume all possible options are "Active".
-
- Sequential order of Modifications (if ALL are Active):
-
- 1. Non-Text characters are replaced with Spaces.
- 2. Lower case letters converted to Uppercase.
- 3. Stripping (Removing) a part/s of each line.
- 4. "Modifications" (multiple modification procedures).
-
- "STRIPPING":
-
- Allows you to Remove parts of each line. The lines Must have Uniform
- Columns unless you select the Pattern Strip. The "Pattern" can be a Single
- Character, Word, etc. You can Strip from the Beginning of each Line up to the
- Pattern (does Not include the Pattern) or From the Pattern (does Not include
- the Pattern) to the End of each Line. NOTE: If you want the Pattern Removed
- too, use "Modify 3" to Remove the Pattern (the Same Pattern Entered for
- Stripping). NOTE: "Stripping" operates on each Line before "Modifications".
- Character Counting reference is the other form (No Pattern) of Stripping.
-
- Note: "Stripping" removes a part/s of each line while "Clipping" ("Modify"
- 7.1) removes parts of the File by Lines.
-
- The "Modifications" order is just as they are numbered except with "Modify"
- number 7 (added later). Now the "Modification" order is:
-
- 7.2 (Reformat or Add CRs to Text).
- 7.1 Clip a Portion/s of the Text file (Clip by lines).
- 1 to 6 are in the proper order (following "Modification" 7).
-
- Example: Number 1 for Spaces removal comes first. Number 2 to reduce a
- sequence of characters, is second, etc. If all possible Modifications are
- being used, each line is Modified in turn, starting with number 7 parameters,
- then number 1,2,3,4,5 or 6 (you can't have both 5 and 6 active at the same
- time). You should be aware of this since some odd affects can result if you
- don't think about the order. Here is a simple example: You use option number
- 3 to remove a pattern and entered the same pattern in option 4 to replace it
- with another. By the time number 4 operates on the line, the pattern won't be
- there (removed by "Modify" number 3).
-
- For "Modifications" 1 to 6 (except 3), there are 3 categories: Case
- Sensitive, Insensitive, and Numbers (Decimal) that represent characters
- (usually used for non-Text such as Control characters, but can also be Text
- characters). These are performed in the same sequential order as their
- numbers.
-
- IMPORTANT NOTES:
-
- 1. IF you "Modify" a file (Create another File) and you notice that it is
- smaller than the Original, one possible reason could be that the Original File
- contained Zeros. Since a Zero is used as an End of Line reference during
- "Modifications", all Zeros that are found in the Original File are discarded.
-
- 2. Since there is such a wide range of possible combinations in performing
- more than one Modification on a File at the same time, I have no way of
- knowing about the possibility of conflicts. However, you need not worry if
- the outcome is not what you expected since the ORIGINAL FILE is NEVER Altered.
- The "View a File" allows you to Preview the outcome of Modifications before
- you decide to Print or Create another File. I do know if you are Clipping
- ("Modify" 7.1) a "Long Line" text file, and at the same time, you are
- Replacing ("Modify" 4) or Removing ("Modify" 3) a Pattern, there is a
- possibility that the Pattern could be spilt and not found to be Replaced or
- Removed. The Pattern will NOT be lost because it is split, but it won't be
- changed or removed. Since "Clipping" counts Screen Lines (up to 80 characters
- per Screen Line) as a reference, "Long Line" text is ended in the Line Buffer
- at 80 characters for Line Counting (Clipping reference). The solution is
- SIMPLE, perform the Clipping "Modification" on a second Pass.
-
- 3. Modifications on Documents without the standard CR,LF (or CR) ending each
- line may not always be complete due to the Limited size of the Line Buffer.
- It is possible for a "Pattern", which contains more that one word, to be
- Split, one word of a two word pattern can be in one "Line" (near End of Line
- Buffer) while the second word will be in the next "line". This also applies
- to reducing a Sequence, etc.
-
- 4. TM was NOT designed to be totally "Idiot" proof. One example: For
- "Modifications", if you enter letters instead of numbers at the Numbers
- category, the outcome is uncertain (I never tried it).
-
- CONCLUSION:
-
- This is NOT a "Free" program. A small Donation will be Greatly Appreciated.
- For a Minimum of $5.00 (U.S.A.), I will send you several other MS Dos Programs
- that I made on a 3.5" Disk, or Attach it (.ZIP Package) to E-Mail to you if you
- prefer. The Donation will Motivate me to Develop more Programs (and make
- Improvements).
-
- By request, I will send you a List of my other Programs (with descriptions)
- in E-Mail or "Snail Mail" (send a S.A.S.E.).
-
- Comments or Complaints are always welcomed. If you use "Snail Mail" and
- expect a reply, please include a S.A.S.E.
-
- E-Mail: jaugust@bellatlantic.net
-
- John Augustine N3AOF
- 3129 Earl St.
- Laureldale, Pa 19605
- (610) 929-8850
-